# -*- coding:utf-8 -*-
from PySide.QtCore import *
from PySide.QtGui import *
import sys

QTextCodec.setCodecForTr(QTextCodec.codecForName("utf8"))

class ExtensionDialog(QDialog):
    def __init__(self,parent=None):
        super(ExtensionDialog, self).__init__(parent)
        self.setWindowTitle(self.tr("可扩展窗口"))

        nameLabel=QLabel(self.tr("姓名："))
        nameLineEdit=QLineEdit()

        sexLabel=QLabel(self.tr("性别："))
        sexComboBox=QComboBox()
        sexComboBox.addItem(self.tr("男"))
        sexComboBox.addItem(self.tr("女"))

        okButton=QPushButton(self.tr("确定"))
        detailButton=QPushButton(self.tr("详细"))

        btnBox=QDialogButtonBox(Qt.Vertical)
        btnBox.addButton(okButton,QDialogButtonBox.ActionRole)
        btnBox.addButton(detailButton,QDialogButtonBox.ActionRole)



        layout=QGridLayout(self)
        layout.setSpacing(10)
        layout.addWidget(nameLabel,0,0)
        layout.addWidget(nameLineEdit,0,1)
        layout.addWidget(okButton,0,2)
        layout.addWidget(sexLabel,1,0)
        layout.addWidget(sexComboBox,1,1)
        layout.addWidget(detailButton,1,2)


if __name__=="__main__":
    app=QApplication(sys.argv)
    extensionDialog = ExtensionDialog()
    extensionDialog.show()
    sys.exit(app.exec_())